<template>
  <div id="login">
    <h1>登录页面</h1>
    账号：<input type="text" v-model="username"> <br>
    密码：<input type="password" v-model="password"> <br>
    <input type="button" @click="login" value="登录"> <br>
    <h1>{{showtime}}</h1>
  </div>
</template>
<script>
export default {
  name: 'LoginView',
  data() {
    return {
      username: '',
      password: '',
      showtime: ''
    }
  },
  methods: {
    login() {
      this.$axios.get("login?username="
 + this.username + "&password=" + this.password)
        .then(
          res => {
            this.showtime = res.data.msg
          }
        )
        .catch();
    }
  },
}
</script>

<style>
</style>